--
-- Created by IntelliJ IDEA.
-- User: suzhen
-- Date: 17-2-14
-- Time: 上午10:11
-- To change this template use File | Settings | File Templates.
--

print("i am\r\nmessage")
w = { x = 0, y = 0, label = "console" }
w[1] = "another field"
w.f = "1--"

print(w.f)

a = 1
b = 2
c = 3

do
    local name1 = "usr 1"
    local name2 = "usr 2"
    print(name1 and name2)

    s, e = string.find("hello Lua users", "Lua")
    print(s, e) --> 7  9
end


do
    local a = 10
    local b = 20
    local c = 30
    print(a .. "\t" .. b .. "\t" .. c)
end

do
    local names = { "Peter", "Paul", "Mary" }
    print(string.format("this is first name -> %s", names[1]))
    days = {
        "Sunday", "Monday", "Tuesday", "Wednesday",
        "Thursday", "Friday", "Saturday"
    }
    local revDays = {}
    for i, v in ipairs(days) do
        revDays[v] = i
    end

    for k, v in pairs(revDays) do
        print(k .. "->" .. v)
    end
end

